#ifndef _PROTOCOL_OFFSET_H_
#define _PROTOCOL_OFFSET_H_


typedef struct
{
	unsigned char offset;
    char* exp;
}YX_ERR_WARN;
/* 直流 遥信 数组下标偏移  pf=0x22  pgn=8704 */
#define DC_IND_WORK_STARUS_OFFSET		0
#define DC_IND_TOTAL_FAULT_OFFSET	    2  //总故障
#define DC_IND_TOTAL_WARN_OFFSET	    3  //总告警
#define DC_IND_EMERSTOP_FAULT_OFFSET	4   //急停按钮动作故障
#define DC_IND_SMOKE_ALARM_OFFSET		5   //烟感故障
#define DC_IND_AC_BREAKER_OFFSET		6   //交流输入断路器故障
#define DC_IND_DC_OUT_CONTACTOR_OFFSET	7   //直流母线输出接触器拒动/误动故障
#define DC_IND_DC_OUT_FUSES_OFFSET		8   //直流母线输出熔断器故障
#define DC_IND_INTERFACE_ELE_LOCK_FAULT_OFFSET  9     //充电接口电子
#define DC_IND_CHARGE_FAN_OFFSET		        10    //充电桩风扇故障
#define DC_IND_THUNDERBOLT_OFFSET		        11    //避雷器故障
#define DC_IND_INSULATION_OFFSET		        12    //绝缘监测故障
#define DC_IND_BATTERY_REVERSE_OFFSET		    13    //电池极性反接故障
#define DC_IND_CHARGING_CAR_GUIDE_OFFSET	    14    //充电中车辆控制导引故障
#define DC_IND_PILE_OVERTURNED_OFFSET		    15    //充电桩过温故障
#define DC_IND_GUNS_OVERTURNED_OFFSET		    16    //充电接口过温故障
#define DC_IND_GUNS_NO_HOMELESS_OFFSET		    17    //充电枪未归位告警
#define DC_IND_BMS_COMMUNICATION_OFFSET		    18    //BMS 通信故障
#define DC_IND_INPUT_V_OVER_OFFSET		        19    //输入电压过压故障
#define DC_IND_INPUT_V_UNDER_OFFSET		        20    //输入电压欠压故障
#define DC_IND_DC_BUS_OUT_V_OVER_OFFSET		    21    //直流母线输出过压故障
#define DC_IND_DC_BUS_OUT_V_UNDER_OFFSET	    22    //直流母线输出欠压故障
#define DC_IND_DC_BUS_OUT_A_OVER_OFFSET		    23    //直流母线输出过流故障
#define DC_IND_CHARGE_MODULE_OFFSET		        24    //充电模块故障
#define DC_IND_MODULE_AC_INPUT_OFFSET		    25    //充电模块交流输入故障
#define DC_IND_MODULE_AC_IN_V_OVER_OFFSET	    26    //充电模块交流输入过压故障
#define DC_IND_MODULE_AC_IN_V_UNDER_OFFSET	    27    //充电模块交流输入欠压故障
#define DC_IND_MODULE_AC_IN_PHASE_OFFSET	   28     //充电模块交流输入缺相故障
#define DC_IND_MODULE_DC_OUT_SHORT_OFFSET	   29     //充电模块直流输出短路故障
#define DC_IND_MODULE_DC_OUT_A_OVER_OFFSET	   30     //充电模块直流输出过流故障
#define DC_IND_MODULE_DC_OUT_V_OVER_OFFSET	   31     //充电模块直流输出过压故障
#define DC_IND_MODULE_DC_OUT_V_UNDER_OFFSET    32     //充电模块直流输出欠压故障
#define DC_IND_MODULE_OVERTURNED_OFFSET		   33     //充电模块过温故障
#define DC_IND_MODULE_COMMUNICATION_OFFSET     34     //充电模块通信故障
#define DC_IND_MODULE_FAN_OFFSET		       35     //充电模块风扇故障
#define DC_IND_CONNECT_CAR_OFFSET		       36     //车辆连接状态       0连接  1未连接
#define DC_IND_GUNS_STATUS_OFFSET		       37     //充电桩充电枪座状态  0连接  1未连接
#define DC_IND_ELE_LOCK_STATUS_OFFSET		   38     //充电接口电子锁状态  0解锁  1 锁止
#define DC_IND_DC_OUT_CONTACTOR_STATUS_OFFSET  39     //直流输出接触器状态  00H： 分断  01H： 闭合
#define DC_IND_PRIVATE_WARN_NUM_OFFSET         40     //私有告警编号
#define DC_IND_PRIVATE_VALUE_OFFSET	           41     //私有告警数值


/* 直流 遥信 数组下标偏移  pf=0x23  pgn=8960 */
#define DC_IND_DOOR_FAULT_OFFSET	                      1 //门禁故障
#define DC_IND_DC_BUS_OUT_CONTACTOR_ADHESION_FAULT_OFFSET 2 //直流输出接触器粘连故障
#define DC_IND_INSULATION_WARN_OFFSET	                  3 //绝缘监测告警
#define DC_IND_DISCHARGE_LOOP_WARN_OFFSET                 4 //泄放回路故障
#define DC_IND_CHARGE_PILE_OVERTURNED_WARN_OFFSET         5 //充电桩过温告警
#define DC_IND_CHARGE_GUN_OVERTURNED_WARN_OFFSET          6 //充电枪过温告警
#define DC_IND_AC_IN_CONTACTOR_ERR_ACTION_OFFSET          7 //交流输入接触器据动/误动故
#define DC_IND_AC_IN_CONTACTOR_ADHESION_FAULT_OFFSET      8 //交流输入接触器粘连故障
#define DC_IND_ASSIST_POWER_FAULT_OFFSET                  9 //辅助电源故障
#define DC_IND_PARALLEL_CONTACTOR_ERR_ACTION_OFFSET       10 //并联接触器据动/误动故障
#define DC_IND_PARALLEL_CONTACTOR_ADHESION_FAULT_OFFSET   11 //并联接触器粘连故障
#define DC_IND_PARALLEL_CONTACTOR_STATUS_OFFSET           12  // 并联接触器状态
#define DC_IND_MODULE_EMERGENCY_STOP_OFFSET               13 // 模块紧急停机状态
#define DC_IND_DEVICE_FLOODING_FAULT_OFFSET               14 // 充电桩水浸故障
#define DC_IND_BOX_ACCESS_FAULT_OFFSET                    15 // 充电机柜门禁故障
#define DC_IND_MODULE_FLOODING_FAULT_OFFSET               16 // 充电机柜水浸故障
#define DC_IND_MODULE_SMOKING_FAULT_OFFSET                17  // 充电机柜烟感故障
#define DC_IND_POWER_CTRL_MODULE_COMM_FAULT_OFFSET        18  // 功率控制模块通信故障
#define DC_IND_POWER_CTRL_MODULE_COMM_WARN_OFFSET         19  // 功率控制模块通信告警
#define DC_IND_POWER_CTRL_MODULE_FAULT_OFFSET             20  // 功率控制模块故障
#define DC_IND_POWER_CTRL_MODULE_WARN_OFFSET              21  // 功率控制模块告警
#define DC_IND_SWITCH_MODULE_COMM_FAULT_OFFSET            22  // 开关模块通信故障
#define DC_IND_SWITCH_MODULE_COMM_WARN_OFFSET             23  // 开关模块通信告警
#define DC_IND_SWITCH_MODULE_FAULT_OFFSET                 24  // 开关模块故障
#define DC_IND_SWITCH_MODULE_WARN_OFFSET                  25  // 开关模块告警
#define DC_IND_CONTROLER_BMS_FAULT_OFFSET                 26  // 直流充电主控模块判断BMS故障
#define DC_IND_BMS_SEND_FAULT_OFFSET                      27  // BMS发送故障信息
#define DC_IND_MODULE_LOOP_FAULT_OFFSET                   28  // 充电模块泄放故障
#define DC_IND_INSULATION_DEVICE_COMM_FAULT_OFFSET        29  // 绝缘监测仪通信故障
#define DC_IND_ENVI_MONITOR_COMM_FAULT_OFFSET	          30  // 环境监控板通信故障
#define DC_IND_LAMP_COMM_FAULT_OFFSET	                  31  // 灯板通信故障
#define DC_IND_METER_COMM_FAULT_OFFSET                    32

// zhouhao 2021-07-27 add 虚遥信
#define XYX_CAN_COMM_STATUS_OFFSET						  0		// CAN通讯故障
#define XYX_METER_COMM_STATUS_OFFSET					  1     // 电表通讯故障

/* 交流 遥信 数组下标偏移  pf=0x32  pgn=12800 */
#define AC_IND_WORK_STATUS_OFFSET		0
#define AC_IND_TOTAL_FAULT_OFFSET	                                                                        2               //总故障
#define AC_IND_TOTAL_WARN_OFFSET	                                                                        3               //总告警
#define AC_IND_CONNECT_SWITCH_OFFSET		                                                            4               //车辆连接状态
#define AC_IND_EMERSTOP_OFFSET			                                                                    5               //急停按钮动作故障
#define AC_IND_THUNDERBOLT_OFFSET		                                                                6               //避雷器故障
#define AC_IND_GUNS_NO_HOMELESS_OFFSET		                                                    7               //充电枪未归位告警
#define AC_IND_OVERTHRNED_OFFSET		                                                                    8               //充电桩过温故障
#define AC_IND_INPUT_V_OVER_OFFSET		                                                                9               //输入电压过压故障
#define AC_IND_INPUT_V_UNDER_OFFSET		                                                               10              //输入电压欠压故障
#define AC_IND_OUT_CONTACTOR_STATUS_OFFSET	                                                   11              //交流输出接触器状态
#define AC_IND_CHARGING_CAR_GUIDE_OFFSET	                                                       12              //充电中车辆控制导引故障
#define AC_IND_AC_CONTACTOR_OFFSET		                                                               13              //交流输出接触器拒动/误动故障
#define AC_IND_OUT_A_OVER_ALARM_OFFSET		                                                       14              //输出过流告警
#define AC_IND_OUT_A_OVER_FAULT_OFFSET	                                                           15              //输出过流故障
#define AC_IND_AC_BREAKER_OFFSET		                                                                   16              //交流输入断路器故障
#define AC_IND_INTERFACE_ELE_LOCK_OFFSET	                                                           17              //充电接口电子锁状态
#define AC_IND_INTERFACE_ELE_LOCK_FAULT_OFFSET	                                               18              //充电接口电子锁故障
#define AC_IND_INTERFACE_OVERTURNED_OFFSET	                                                   19              //充电接口过温故障
#define AC_IND_CHARGING_CONNECT_STATUS_OFFSET	                                           20              //充电连接状态CC
#define AC_IND_CHARGING_CONTROL_STATUS_OFFSET	                                           21              //充电控制状态CP
#define AC_IND_PE_DISCONNECT_OFFSET		                                                               23               //PE 断线故障
#define AC_IND_DOOR_FAULT_OFFSET                                                                          24               //门禁故障
#define AC_IND_CHARGE_PILE_OVERTURNNED_WARN_OFFSET                                  25               //充电桩过温告警
#define AC_IND_CHARGE_INTERFACE_OVERTURNNED_WARN_OFFSET                       26               //充电接口过温告警
#define AC_IND_OUT_CONTACTOR_ADHESION_FAULT_OFFSET                                    27              //交流输出接触器粘连故障
#define AC_IND_GENERAL_ALARM_FAULT_OFFSET	                                                        28               //通用告警和故障
#define AC_IND_PRIVATE_WARN_NUM_OFFSET                                                             29               //私有告警编号
#define AC_IND_PRIVATE_WARN_VALUE_OFFSET                                                           30               //私有告警数值

#endif
